LassoScript Utility
Basics Browse Detail

[String->CompareCodePointOrder]

Tag Link [String->CompareCodePointOrder] Category String
Type Member Source Available No
Support Preferred Version 7.0
Change Unchanged Data Source Any
Output Type Integer Security None
Implementation LCAPI Sets Lasso 8.5, Lasso 8.0, Lasso 7.0

Description

[String->CompareCodePointOrder] compares the base string to the first parameter and returns True if they are equal or False otherwise. Comparisons are made case insensitive by default. An optional -Case parameter compares the string taking case into account.

This tag works identically to [String->Compare], but comparisons are accurate even for Unicode charaacters with code points greater than U+10000.

A second form of the tag compares the base string to a portion of a parameter string. The first parameter is an offset into the comparison string. The second parameter is the length of characters in the comparison string to be taken into account. And, the third parameter is the comparison string.

Additional optional fourth and fifth parameter specify and offset and length into the base string. This allows a portion of the base string to be compared to a portion of the comparison string.

Syntax

[If: 'Base String'->(CompareCodePointOrder: 'Param String')] ... [/If]

[If: 'Base String'->(CompareCodePointOrder: 'Param String', -Case)] ... [/If]

<?LassoScript
If: 'Base String'->(CompareCodePointOrder: 7, 6, 'Param String');
...
/If;
?gt;

<?LassoScript
If: 'Base String'->(CompareCodePointOrder: 7, 6, 'Param String', 6, 6);
...
/If;
?gt;

Parameters

Required Parameters
Comparison String The comparison string. This is the only required parameter.
Optional Parameters
Offset An offset into the comparison string.
Length The number of characters in the comparison string which should be taken into account.
Offset An offset into the base string.
Length The number of characters in the base string which should be taken into account.

Examples

To compare two strings using Unicode code point order:

Use the [String->CompareCodePointOrder] tag. The following example compares the base string to the first paramter of [String->Compare]. True is returned since the two strings have the same value and the -Case keyword was not specified.

[If: 'Quick fox'->(CompareCodePointOrder: 'QUICK FOX')]True[Else]False[/If]

True

Related Tags

Category Tags